import HomePage_HeaderOperationComponent from "../../component/headerOperation"
import { ReactComponent as SubstationMaintenanceSvg } from '../../../../assets/svg/substationMaintenance.svg'
import { ReactComponent as mainTransformerMaintenance } from '../../../../assets/svg/mainTransformerMaintenance.svg'
import { ReactComponent as uprightMaintenance } from '../../../../assets/svg/uprightMaintenance.svg'
import { ReactComponent as lineMaintenance } from '../../../../assets/svg/lineMaintenance.svg'
import { ReactComponent as maintenanceScheduledInspectionData } from '../../../../assets/svg/maintenanceScheduledInspectionData.svg'
import { ReactComponent as dataFileManagement } from '../../../../assets/svg/dataFileManagement.svg'
import { ReactComponent as maintenanceTestingEquipment } from '../../../../assets/svg/maintenanceTestingEquipment.svg'
import { Outlet, useLocation } from "react-router-dom"
import { $headerOperationBtnData, $headerOperationConditionData } from "../../../../common/utils"


// 主页-数据维护页面
const HomePage_DataMaintenancePage: React.FC = () => {
  const tabList = [
    {
      svg: SubstationMaintenanceSvg,
      title: "站点维护",
      router: "substationMaintenance",
      operationData: {
        btnList: [
          $headerOperationBtnData("导出", "export"),
          $headerOperationBtnData("新增", "add"),
          $headerOperationBtnData("查询", "search", {}, true),
        ],
        conditionList: [
          $headerOperationConditionData["singleBtn"]("站点", "站点"),
          $headerOperationConditionData["voltageLevel"],
        ],
        singleBtnKey: "id",
        singleBtnValueKey: "id",
        initParamsData: {
          id: "",
          volLevel: "全部"
        }
      }
    }, 
    {
      svg: mainTransformerMaintenance,
      title: "主变维护",
      router: "mainTransformerMaintenance",
      operationData: {
        btnList: [
          $headerOperationBtnData("导出", "export"),
          $headerOperationBtnData("查询", "search", {}, true),
        ],
        conditionList: [
          $headerOperationConditionData["monitoringDevice"](),
          $headerOperationConditionData["singleBtn"]("站点", "站点"),
          $headerOperationConditionData["input"]("通信地址", "通信地址"),
        ],
        singleBtnKey: "stationID",
        singleBtnValueKey: "id",
        initParamsData: {
          monitorDevice: null,
          stationID: "",
          mailingAddress: ""
        }
      }
    },
    {
      svg: uprightMaintenance,
      title: "隔直维护",
      router: "uprightMaintenance",
      operationData: {
        btnList: [
          $headerOperationBtnData("导出", "export"),
          $headerOperationBtnData("新增", "add"),
          $headerOperationBtnData("查询", "search", {}, true),
        ],
        conditionList: [
          $headerOperationConditionData["singleBtn"]("站点", "站点"),
        ],
        singleBtnKey: "stationID",
        singleBtnValueKey: "id",
        initParamsData: {
          stationID: "",
        },
      }
    },
    {
      svg: lineMaintenance,
      title: "线路维护",
      router: "lineMaintenance",
      operationData: {
        btnList: [
          $headerOperationBtnData("导出", "export"),
          $headerOperationBtnData("查询", "search", {}, true),
        ],
        conditionList: [
          $headerOperationConditionData["monitoringDevice"](),
          $headerOperationConditionData["singleBtn"]("直连站点", "站点"),
          $headerOperationConditionData["input"]("通信地址", "通信地址"),
        ],
        singleBtnKey: "id",
        singleBtnValueKey: "line",
        initParamsData: {
          monitorDevice: null,
          id: "",
          mailingAddress: ""
        }
      }
    },
    {
      svg: maintenanceScheduledInspectionData,
      title: "定检数据维护",
      router: "maintenanceScheduledInspectionData",
      operationData: {
        btnList: [
          $headerOperationBtnData("导出", "export"),
          $headerOperationBtnData("新增", "add"),
        ]
      }
    },
    // {
    //   svg: dataFileManagement,
    //   title: "数据文件管理",
    //   router: "dataFileManagement",
    //   operationData: {
    //     btnList: [
    //       $headerOperationBtnData("下载", "export"),
    //       $headerOperationBtnData("上传", "upload", {
    //         mode: "multiple",
    //         monitoringType: "主变",
    //         modalName: "选择上传数据范围"
    //       }),
    //       $headerOperationBtnData("查询", "search", {}, true),
    //     ],
    //     conditionList: [
    //       $headerOperationConditionData["singleBtn"]("站点", "站点"),
    //       $headerOperationConditionData["multipleBtn"]("主变", "主变"),
    //       $headerOperationConditionData["samplingRate"],
    //       $headerOperationConditionData["dateTimePickerRange"]("时段", "时段"),
    //     ]
    //   }
    // },
    {
      svg: maintenanceTestingEquipment,
      title: "监测设备维护",
      router: "maintenanceTestingEquipment",
      operationData: {
        btnList: [
          $headerOperationBtnData("导出", "export"),
          $headerOperationBtnData("新增", "add"),
          $headerOperationBtnData("查询", "search", {}, true),

        ],
        conditionList: [
          $headerOperationConditionData["monitoringType"](),
          $headerOperationConditionData["input"]("设备ID", "deviceID"),
        ],
        initParamsData: {
          monitoringType: "全部",
          deviceID: ""
        }
      }
    },
  ]

  return (
    <div className="homePage-page">
      <HomePage_HeaderOperationComponent tabList={tabList} />
      <main className="homePage-page__main">
        <Outlet/>
      </main>
    </div>
  )
}

export default HomePage_DataMaintenancePage